﻿Imports MICROFORMA.BEL
Imports MICROFORMA.DAL


Public Class RolBL


    Private _Rol_DA As RolDA = Nothing

    Public Function Add(ByVal RolBE As RolBE) As String
        If _Rol_DA.Add(RolBE) = "OK" Then
            If RolBE.Estado = "0" Then
                RolBE.EstadoDescripcion = "Activo"
                Return "OK"
            End If
        End If
    End Function

    Public Function getIdLastRecord() As Int16
        Return _Rol_DA.getIdLastRecord
    End Function

    Public Function Edit(ByVal RolBE As RolBE) As String
        Return _Rol_DA.Edit(RolBE)
    End Function

    Public Function Delete(ByVal RolBE As RolBE) As String
        If _Rol_DA.Delete(RolBE) = "OK" Then
            If RolBE.Estado = "1" Then
                RolBE.EstadoDescripcion = "Bloqueado"
                Return "OK"
            End If
        End If
    End Function

    Public Function List() As RolBECollection
        Return _Rol_DA.List()
    End Function

    Public Function GetList() As DataTable
        Return _Rol_DA.GetList
    End Function

    Public Sub New()
        _Rol_DA = New RolDA
    End Sub

End Class


